import requestApi from "../utils/request";
let base_url = "http://192.168.0.182:3008/api";

// 大商创的接口
let base_url2 = "/api";




// 用户名和密码登录
export const UserLoginApi = (user_name, user_password) => {
    return requestApi(base_url + "/user/login", {
        user_name,
        user_password
    }, "post")
}


// 获取短信验证码

export const getPhoneCodeApi = (url, params, type) => {
    return requestApi(base_url + url, params, type)
}


// 短信登录接口

export const phoneLoginApi = (url, params, type) => {
    return requestApi(base_url + url, params, type)
}

// 添加用户接口
export const adduserApi = (url, params, type) => {
    return requestApi(base_url + url, params, type)
}


// 首页列表
export const getIndexListApi = (params) => {
        return requestApi(base_url2 + "/goods/type_list", params)
    }
    // 分类左侧
    // https://x.dscmall.cn/api/catalog/list
export const getCategoryLeftApi = () => {
    return requestApi(base_url2 + "/catalog/list")
}

// 分类右侧
// https://x.dscmall.cn/api/catalog/list/858
export const getCategoryRightApi = (cat_id) => {
    return requestApi(base_url2 + "/catalog/list/" + cat_id)
}

// 分类列表
export const postCategoryListApi = (params) => {
    return requestApi(base_url2 + "/catalog/goodslist", params, "post")
}

// 品牌列表
export const postBrandListApi = (params) => {
    return requestApi(base_url2 + "/catalog/brandlist", params, "post")
}

// 商品详情页
export const postDetailApi = (params) => {
    return requestApi(base_url2 + "/goods/show", params, "post")
}